﻿function editDetail() {
    var detail = document.getElementById('detail');
    $('input[type="text"]', detail).addClass('EditIsOn');
    document.getElementById('editLink').style.visibility = 'hidden';
    document.getElementById('saveLink').style.visibility = 'visible';
}

function saveDetail() {
    var vmodel = Rajon.vmodel('detail');
    vmodel.updateModelSource();

    if (!vmodel.hasCommitErrors) {
        var detail = document.getElementById('detail');
        $('input[type="text"]', detail).removeClass('EditIsOn');
        document.getElementById('saveLink').style.visibility = 'hidden';
        document.getElementById('editLink').style.visibility = 'visible';
    }
}